package com.example.demo.entity;

import android.os.Parcel;
import android.os.Parcelable;

public class ChatContact implements Parcelable {

    private String name;
    private int img;

    public ChatContact() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getImg() {
        return img;
    }

    public void setImg(int img) {
        this.img = img;
    }


    @Override
    public int describeContents() { return 0; }

    @Override
    public void writeToParcel(Parcel dest, int flags)
    {
        dest.writeString(this.name);
        dest.writeInt(this.img);
    }

    public void readFromParcel(Parcel source)
    {
        this.name = source.readString();
        this.img = source.readInt();
    }

    protected ChatContact(Parcel in)
    {
        this.name = in.readString();
        this.img = in.readInt();
    }

    public static final Parcelable.Creator<ChatContact> CREATOR = new Parcelable.Creator<ChatContact>()
    {
        @Override
        public ChatContact createFromParcel(Parcel source) {return new ChatContact(source);}

        @Override
        public ChatContact[] newArray(int size) {return new ChatContact[size];}
    };
}
